put char 1 to 80 of line item 1 of xTract of searchMe & return after searchHits
put numHit + 1 into numHit
set i7_Text of window "Find" to numHit
end repeat
else beep
end if
end wsFindHit
on findPICTname x
global hitPath, startChar, howFarDown, aFoundLine, lineNo, searchMe
put locateF() & "data:aris.data" into fileName
open file fileName
read from file fileName until "Γëê"
close file fileName
repeat with i = 1 to the number of lines in it
put word 1 of line i of it into item i of xTractor
end repeat
put item howFarDown of aFoundLine into lineNo
get line lineNo of searchMe
repeat with i = 1 to the number of items in xTractor
if it contains (item i of xTractor) then
put line lineNo - i + 1 to lineNo - i + 5 of searchMe into hitPath
exit repeat
end if
end repeat
end findPICTname
on startUsingStack theStack
-- make sure the stack can be 'used'
if theStack is in the stacksInUse then exit startUsingStack
if the number of lines in the stacksInUse = 10
then stop using stack (line 1 of the stacksInUse)
if there is a stack theStack then
start using stack theStack
get the result
if it is not empty then
if it is "Can't start using home." then exit startUsingStack -- Γêå
answer it
exit to hyperCard
end if
end if
end startUsingStack
on stopUsingStack theStack
if theStack is in the stacksInUse
then stop using stack theStack
end stopUsingStack
on BuildSndList
global sndKind,thePath,sndList,theSnd,List2,lastPath,windowName,lastSnd,theDialog,numberOfSnds
global setSound,sKind,sndListWithIcons
put locateF() & "snd Files:" into thePath
if sndList = empty or thePath Γëá lastPath then
put locateF() & "data:sndData" into fileName
if IsFile(filename) then
open file filename
read from file filename until empty
close file filename
put it into sndList
else
put GetDir(thePath,"F","o=nr") into sndList
repeat with i = 1 to the number of lines of sndList
put "," before line i of sndList -- Add item that normally would contain the snd Type
end repeat
put ChangeStr(sndList,"[44]",",","all") into sndList -- Change "[44]'s" back into commas
end if
put the number of lines of sndList into numberOfSnds
if setSound = empty or thePath Γëá lastPath then
put empty into setSound
put empty into sKind
put empty into sndListWithIcons
repeat with i = 2 to 101
set cursor to busy
set numberformat to "0.#" -- circle
if (i-1) Γëñ numberOfSnds then
put item 1 of line (i-1) of sndList into x
if x is not in sKind then
put x into line (number of lines of sKind + 1) of sKind
end if
findInXCMD sKind,x,1,FALSE
put (item 1 of the result) * 1000 into sndKind
put sndKind + round(((last item of line (i-1) of sndList/1024)/22)/2.5) & return after setSound
put sndKind + round(((last item of line (i-1) of sndList/1024)/22)/2.5) && item 2 to number of items of line (i-1) of sndList -1 of line (i-1) of sndList & return after sndListWithIcons
end if
end repeat
end if
put thePath into lastPath
end if
set i1_Text of window "Sound Picker" to setSound
get"i5_Text:" & (line 1 of sKind) & return & "i7_Text:" & (line 2 of sKind) & return & "i9_Text:" & (line 3 of sKind) & return & "i11_Text:" & (line 4 of sKind) & return & "i13_Text:" & (line 5 of sKind)
set the properties of window "Sound Picker" to it
end BuildSndList
on playTheSound
global lastSnd,theSnd,myRefNum,sndKind,sndLength,paletteName,numberOfSnds,pList,start_ticks
put locateF() & "Snd Files:" & theSnd into sndfileName
put "" into lastSnd
set i21_Name of window "Sound Picker" to "Stop"
if paletteName contains "Sm" then
set i6_Name of window paletteName to sound
else set i7_Name of window paletteName to sound
set i22_text of window "Sound Picker" to "‹Click the mouse to stop"
put char 1 of i1_SelectionText of window "Sound Picker" & "000" into sndKind
set cursor to 4
put "" into start_ticks
playItAgainSoundm sndfileName,theSnd
set i21_Name of window "Sound Picker" to "Play"
set i22_text of window "Sound Picker" to "Γé¼Double-Click to play sound"
set i19_Text of window "Sound Picker" to sndLength
set numberformat to "0.#"
if i1_Style of window "Sound Picker" = ListWithIcons then
set i1_textOfSelection of window "Sound Picker" to sndKind + round(sndLength/2.5) && theSnd
else
set i1_textOfSelection of window "Sound Picker" to sndKind + round(sndLength/2.5)
end if
if paletteName contains "Sm" then
set i6_Name of window paletteName to nosound
else set i7_Name of window paletteName to nosound
end playTheSound
on wsAnimate
global start_ticks,theSnd,sndKind,sndLength,ifSlideShow,stopShow
if ifSlideShow then
if the mouseClick then
put TRUE into stopShow
exit to hypercard
exit wsAnimate
end if
else if there is a window "Sound Picker" then
if start_ticks="" then put the ticks into start_ticks
if ((the ticks - start_ticks)/60) Γëñ sndLength then
put round(((the ticks - start_ticks)/60)/2.5 + sndKind) into i
set numberformat to "0.#"
get i1_SelectionText of window "Sound Picker"
if i1_Style of window "Sound Picker" = ListOfIcons then
if it Γëá i then
set i1_textofselection of window "Sound Picker" to i
end if
else
if word 1 of it Γëá i then
set i1_textofselection of window "Sound Picker" to i && theSnd
end if
end if
set i19_text of window "Sound Picker" to ((the ticks - start_ticks)/60)
else
put "done" into the sound
exit wsAnimate
end if
end if
end wsAnimate
on showPrefs
global pSize,ifBackground,ifSound,ifInfo,FullStyle,SmallStyle,ThumbStyle,defaultSize,pStyle,ifXL
global bgColor,theData
if item 3 of screenInfo(Main) > 640 then put FALSE into hideBIGSCREEN